from distutils.core import setup, Extension
import glob
import os

from numpy.distutils.misc_util import get_numpy_include_dirs

scripts=['btdst_to_pt.py',
         'btplot.sh',         
         'btcompare_checktime_trees.py',
         ]


scripts_requested = set( [os.path.join('scripts', s) for s in scripts] )
scripts_that_exist = set( glob.glob('scripts/*.sh') + 
                          glob.glob('scripts/*.py') )

scripts_to_install = list(scripts_requested & scripts_that_exist)
scripts_left_out = list( (scripts_requested - scripts_that_exist) )
scripts_left_out.sort()

setup(name='csb-itop',
      version='0.1',
      description='Code csb finds useful for iTOP analysis',
      author='csb',
      packages=['itop',
                'itop.plots',],
      ext_modules=[Extension('itop._itopc',
                             ['itop/src/itopc.c'],
                             include_dirs=get_numpy_include_dirs(),
                             ),
                   ],
      scripts=scripts_to_install,
      )


for script in scripts_left_out:
    print "{0} requested but not present; omitting...".format(script)

